<?php
	class CourseModel extends Model {
		function CourseModel()
		{
			parent::Model();			
		}
		
		function add($data)
		{
			$this->db->set('create_date', 'NOW()', FALSE); 
			$this->db->set('create_by', "'". $this->session->userdata('username') ."'", FALSE);
			$this->db->insert('course_fee', $data);
			
			return $this->db->insert_id();
		}
		
				
		function update($data)
		{			
            $this->db->where('course_id', $data['course_id']);
            $this->db->set('update_date', 'NOW()', FALSE); 
            $this->db->set('update_by', "'". $this->session->userdata('username') ."'", FALSE);
			$this->db->update('course_fee', $data); 
		}
		
		
		function getAll()
		{
			$this->db->order_by("course_id", "asc"); 
			$query = $this->db->get('course_fee');
			return $query->result();
		}
		
	}
?>